class GameMain3 extends eui.Component implements eui.UIComponent {
	public constructor() {
		super();

		this.skinName = "GameMain3Skin"

	}
	private yunshiAin;
	private btnAin;
	private bgAin;
	private gameRule;
	private starGameBtn;
	protected partAdded(partName: string, instance: any): void {
		super.partAdded(partName, instance);
	}
	protected childrenCreated(): void {
		super.childrenCreated();
		this.playAnimation(this.yunshiAin, true);
		this.playAnimation(this.bgAin, true);
		
		this.btnAin.play();
		// 切换页面
		super.childrenCreated();
		this.starGameBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, function () {
				
			SceneManger.createObj(this.stage).loadScene("gameone", Gameone);
		}, this)
		this.gameRule.addEventListener(egret.TouchEvent.TOUCH_TAP, function () {
			SceneManger.createObj(this.stage).loadScene("GameRuler", GameRuler);
		}, this)
		

	}
	//设置循环播放
	private playAnimation(target: egret.tween.TweenGroup, isLoop: boolean): void {


		if (isLoop) {
			for (var key in target.items) {
				target.items[key].props = { loop: true };
			}
		}
		target.play();
	}
}